package com.geping.etl.common.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.geping.etl.common.entity.Sys_Menu;
import com.geping.etl.common.repository.Sys_MenuRepository;
import com.geping.etl.common.service.Sys_MenuService;

@Service
@Transactional
public class Sys_MenuServiceImpl implements Sys_MenuService{
	@Autowired
	private Sys_MenuRepository sys_menuRepository;


	@Override
	public Iterable<Sys_Menu> findAll() {
		
		return sys_menuRepository.findAll();
	}


	@Override
	public List<Sys_Menu> getMenuBySubjectId(String subjectId) {
		
		return sys_menuRepository.getMenuBySubjectId(subjectId);
	}

	@Override
	public Sys_Menu findMax() {
		Sys_Menu sys_menu = null;
		synchronized (this) {
			sys_menu = sys_menuRepository.finMax();
		}
		return sys_menu;
	}

	@Override
	public Sys_Menu save(Sys_Menu sys_menu) {
		return sys_menuRepository.save(sys_menu);
	}

	@Transactional
	@Override
	public int deleteMenu(String panelId) {
		return sys_menuRepository.deleteMenu(panelId);
	}

}
